package net.hn.hnms.biz.project.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.hn.hnms.biz.project.request.ComprehensiveQueryReq;
import net.hn.hnms.biz.project.service.IComprehensiveQueryService;
import net.hn.hnms.biz.project.vo.ComprehensiveQueryVo;
import net.hn.hnms.sys.common.core.domain.R;
import net.hn.hnms.sys.common.core.domain.ResponsePage;
import net.hn.hnms.sys.common.log.annotation.Log;
import net.hn.hnms.sys.common.log.enums.BusinessType;
import net.hn.hnms.sys.common.mybatis.core.page.PageQuery;
import net.hn.hnms.sys.common.satoken.config.AutoSetMineCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 刘昊
 * @version 1.0.0
 * @ClassName ComprehensiveQueryController.java
 * @Description 综合查询
 * @date 2024-03-19 9:23
 */
@Api(value = "综合查询", tags = {"综合查询"})
@RestController
@RequestMapping("/comprehensive")
public class ComprehensiveQueryController {

    @Autowired
    private IComprehensiveQueryService comprehensiveQueryService;

    @ApiOperation("综合查询")
    @PostMapping("/query")
    @AutoSetMineCode
    @Log(title = "综合查询", businessType = BusinessType.UPDATE)
    public R<ResponsePage<ComprehensiveQueryVo>> queryPageList(@Validated @RequestBody ComprehensiveQueryReq req, PageQuery pageQuery) {
        return R.ok("查询成功",comprehensiveQueryService.queryPageList(req,pageQuery));
    }

    @ApiOperation("查询详情")
    @PostMapping("/queryDetails")
    @AutoSetMineCode
    @Log(title = "查询详情", businessType = BusinessType.UPDATE)
    public R<ComprehensiveQueryVo> queryDetails(@Validated @RequestBody ComprehensiveQueryReq req) {
        return comprehensiveQueryService.queryDetails(req);
    }
}
